package com.lintf.bot.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lintf.common.core.domain.BaseEntity;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 
 * @author lintf
 * @TableName bot_consumption
 */
@TableName(value ="bot_consumption")
@Data
public class BotConsumption extends BaseEntity implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 钱袋子id
     */
    private Integer botMoneyId;

    /**
     * 消费标题
     */
    private String consumptionTitle;

    /**
     * 消费金额
     */
    private BigDecimal consumptionTotal;

    /**
     * 消费类型：0-支出；1-提额
     */
    private Integer consumptionType;

    /**
     * 消费余额
     */
    private BigDecimal consumptionBalance;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BotConsumption other = (BotConsumption) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getBotMoneyId() == null ? other.getBotMoneyId() == null : this.getBotMoneyId().equals(other.getBotMoneyId()))
            && (this.getConsumptionTitle() == null ? other.getConsumptionTitle() == null : this.getConsumptionTitle().equals(other.getConsumptionTitle()))
            && (this.getConsumptionTotal() == null ? other.getConsumptionTotal() == null : this.getConsumptionTotal().equals(other.getConsumptionTotal()))
            && (this.getConsumptionType() == null ? other.getConsumptionType() == null : this.getConsumptionType().equals(other.getConsumptionType()))
            && (this.getConsumptionBalance() == null ? other.getConsumptionBalance() == null : this.getConsumptionBalance().equals(other.getConsumptionBalance()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBotMoneyId() == null) ? 0 : getBotMoneyId().hashCode());
        result = prime * result + ((getConsumptionTitle() == null) ? 0 : getConsumptionTitle().hashCode());
        result = prime * result + ((getConsumptionTotal() == null) ? 0 : getConsumptionTotal().hashCode());
        result = prime * result + ((getConsumptionType() == null) ? 0 : getConsumptionType().hashCode());
        result = prime * result + ((getConsumptionBalance() == null) ? 0 : getConsumptionBalance().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", botMoneyId=").append(botMoneyId);
        sb.append(", consumptionTitle=").append(consumptionTitle);
        sb.append(", consumptionTotal=").append(consumptionTotal);
        sb.append(", consumptionType=").append(consumptionType);
        sb.append(", consumptionBalance=").append(consumptionBalance);
        sb.append(", createBy=").append(getCreateBy());
        sb.append(", createTime=").append(getCreateTime());
        sb.append(", updateBy=").append(getUpdateBy());
        sb.append(", updateTime=").append(getUpdateTime());
        sb.append(", remark=").append(getRemark());
        sb.append("]");
        return sb.toString();
    }
}